#include <bits/stdc++.h>

using namespace std;

int main_19()
{
    stack<int> exp;
    char c;
    int top_1,top_2,sum=0;
    while (scanf("%c",&c)&&c!='@')
    {
        if (c=='+')
        {
            top_1=exp.top(),exp.pop();
            top_2=exp.top(),exp.pop();
            exp.push(top_2+top_1);
        }
        else if (c=='-')
        {
            top_1=exp.top(),exp.pop();
            top_2=exp.top(),exp.pop();
            exp.push(top_2-top_1);
        }
        else if (c=='*')
        {
            top_1=exp.top(),exp.pop();
            top_2=exp.top(),exp.pop();
            exp.push(top_2*top_1);
        }
        else if (c=='/')
        {
            top_1=exp.top(),exp.pop();
            top_2=exp.top(),exp.pop();
            exp.push(top_2/top_1);
        }
        else if (c=='.')
        {
            exp.push(sum);
            sum=0;
        }
        else
        {
            sum=sum*10+c-'0';
        }
    }
    printf("%d\n",exp.top());
    return 0;
}
